<template>
  <div>
    <el-container>
      <el-header>
        <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect"
          active-text-color="#ffd04b" text-color="#fff" background-color="#545c64" router>
          <el-menu-item index="/index">首页</el-menu-item>
          <el-menu-item index="/shop">商城</el-menu-item>
          <el-menu-item index="/login">登录</el-menu-item>
          <el-menu-item index="/my">我的</el-menu-item>
        </el-menu>
      </el-header>
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>

  </div>
</template>

<script>
  export default {
    data() {
      return {
        activeIndex: '/index'
      }
    },
    methods: {
      handleSelect(key) {
        this.$router.push(key)
      }
    },
  }
</script>

<style lang="scss">

</style>
